﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StyleMVVM.Data.Collections;

namespace StyleMVVM.Data
{
	public class PropertyAttribute
	{
		private Type attributeType;
		private Type owner;
		private string name;
		private object defaultValue;
		private Action<AttributeBag, PropertyAttributeChangedArgs> attributeChanged;

		protected internal PropertyAttribute(string attributeName,
		                                     Type attributeType,
		                                     Type owningtype,
		                                     object defaultValue,
		                                     Action<AttributeBag, PropertyAttributeChangedArgs> changeDelegate)
		{
			Name = attributeName;
			AttributeType = attributeType;
			Owner = owningtype;
			DefaultValue = defaultValue;
			AttributeChanged = changeDelegate;
		}

		public Type AttributeType
		{
			get { return attributeType; }
			private set { attributeType = value; }
		}

		public Type Owner
		{
			get { return owner; }
			private set { owner = value; }
		}

		public string Name
		{
			get { return name; }
			private set { name = value; }
		}

		public object DefaultValue
		{
			get { return defaultValue; }
			private set { defaultValue = value; }
		}

		protected internal Action<AttributeBag, PropertyAttributeChangedArgs> AttributeChanged
		{
			get { return attributeChanged; }
			private set { attributeChanged = value; }
		}
	}
}